﻿using System;
using System.Linq;
using System.Web.Security;
using Deixei.Domain;
using Deixei.Domain.Service;
using Deixei.Infrastructure;
using Deixei.Web;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

namespace Deixei.UnitTestProject
{

    
    public static class TestSetup
    {
        public static void Start()
        {
            System.Data.Entity.Database.SetInitializer<DataContext>(new DataContextInitializer());
            DeixeiContainer.Registration();
            DomainUnityRegistration.Registration();
        }
    }

    [TestClass]
    public class AuthorizationServiceUnitTest
    {
        [TestMethod]
        public void GetAllUser_TestMethod()
        {
            TestSetup.Start();

            AuthorizationService service = new AuthorizationService();
            IQueryable<User> list = service.GetAllUsers("deixei");
            Assert.IsNotNull(list);
        }


        [TestMethod]
        public void ApplicationName_TestMethod()
        {
            TestSetup.Start();
            string name = Membership.ApplicationName;

            Assert.IsNotNull(name);
        
        }

    }
}
